INCLUDE(UsePkgConfig)

PROJECT(pathviewer)
SET(PACKAGE_VERSION 0.1.0)

PKGCONFIG(gtk+-2.0 GTK_INCLUDEDIR GTK_LIBDIR GTK_LINKFLAGS GTK_CFLAGS)
PKGCONFIG(libglade-2.0 LIBGLADE_INCLUDEDIR LIBGLADE_LIBDIR LIBGLADE_LINKFLAGS LIBGLADE_CFLAGS)
PKGCONFIG(pathfinder-nss PATHFINDER_NSS_INCLUDEDIR PATHFINDER_NSS_LIBDIR
			 PATHFINDER_NSS_LINKFLAGS PATHFINDER_NSS_CFLAGS)

SET(EXTRA_CFLAGS "${PATHFINDER_NSS_CFLAGS} ${GTK_CFLAGS} ${LIBGLADE_CFLAGS} -g")
SET(EXTRA_LINKFLAGS "${PATHFINDER_NSS_LINKFLAGS} ${GTK_LINKFLAGS} ${LIBGLADE_LINKFLAGS}")

ADD_EXECUTABLE(pathviewer pathviewer.cc)
SET_TARGET_PROPERTIES(pathviewer 
		      PROPERTIES COMPILE_FLAGS "${EXTRA_CFLAGS}"
		      		 LINK_FLAGS "${EXTRA_LINKFLAGS}")
INSTALL(TARGETS pathviewer RUNTIME DESTINATION bin)
INSTALL(FILES README AUTHORS LICENSE DESTINATION share/doc/pathviewer)

CONFIGURE_FILE(version.h.in version.h)

SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "pathviewer")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "1")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_SOURCE_IGNORE_FILES "/.git/;/.svn/;.*~;/CMakeFiles/;CMakeCache.txt;.cmake;/_CPack_Packages/;version.h$;.tar.gz;.tar.Z;.*#.*";/pathviewer-0.1.0-Source/;Makefile)
SET(CPACK_SOURCE_GENERATOR "TGZ")
INCLUDE(CPack)
